// https://nodejs.org/api/fs.html#fs_fs_watchfile_filename_options_listener
var fs = require('fs');
var path = require('path');

var watchedFile = path.join(__dirname, 'sample.txt');

fs.watch(watchedFile, function(event, filename) {
	console.log('event is: ' + event);
	if (filename) {
		console.log('filename provided: ' + filename);
	} else {
		console.log('filename not provided');
	}
})